import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class SuccessPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final String args = ModalRoute.of(context).settings.arguments;
    return Scaffold(
      appBar: new AppBar(
        backgroundColor: Color(0XFF00A5F1),
        automaticallyImplyLeading: false, //设置没有返回按钮
        title: Text(
          "完成",
          style: TextStyle(fontSize: 18),
        ),
        elevation: 0,
        centerTitle: true,
      ),
      body: Column(
        children: <Widget>[
          Expanded(
              child: Row(
            children: <Widget>[Image.asset("assets/images/complete.png")],
            mainAxisAlignment: MainAxisAlignment.center,
          )),
          FlatButton(
            color: Color(0XFF00A5F1),
            child: Text(
              "确定",
              style: TextStyle(color: Colors.white),
            ),
            onPressed: () {
              if (args != null && args.length > 0) {
                Navigator.popAndPushNamed(context, args);
              } else {
                Navigator.pop(context);
              }
            },
          )
        ],
      ),
    );
  }
}
